﻿using ShopPowerTemplate.Common;
using ShopPowerTemplate.Entities;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace ShopPowerTemplate.ViewModels
{
    public class ProductOptionsViewModel : BindableBase
    {
        private OptionType optionType;
	    public OptionType OptionType
	    {
		    get { return optionType;}
		    set { this.SetProperty(ref this.optionType, value); }
	    }

        private ObservableCollection<Option> options;
        public ObservableCollection<Option> Options
        {
            get { return options; }
            set
            {
                if (this.SetProperty(ref this.options, value))
                {
                    if (options != null && options.Count > 0) SelectedOption = (Option)options[0]; 
                }
            }
        }

        private Option selectedOption;
        public Option SelectedOption
        {
            get { return selectedOption; }
            set
            {
                this.SetProperty(ref this.selectedOption, value);
            }
        }

    }
}
